<?php
if (!defined('IN_XLP')) {
    exit('Access Denied');
}
$Document = array(
    'pageid' => 'news-editmore', //页面标示
    'pagename' => '编辑多条图文', //当前页面名称
    'mycss' => array('content/appmsg'), //加载的css样式表
    'myjs' => array(), //加载的js脚本
    'footerjs'=>array('content/fuelux/fuelux', 'content/combodate/moment.min', '../ueditor/editor_config', '../ueditor/editor.min', 'content/operamasks-ui.min', 'content/appmsg-mul'),
    'head' => true, //加载头部文件
);

include getTpl('header', 'public');
?>
<!--顶部导航 开始-->
<?php include getTpl('top', 'public');?>
<!--顶部导航 结束-->
<!--左侧菜单 开始-->
<?php include getTpl('nav', 'public');?>
<!--左侧菜单 结束-->
<!--主体 开始-->
<!-- content -->
  <section id="content">
    <section class="main padder"> 
    <div class="clearfix"> 
     <h4><i class="fa fa-edit"></i>编辑多条图文</h4> 
    </div> 
    <div class="row"> 
     <div class="col-sm-12"> 
      <section class="panel"> 
       <div class="panel-body"> 
        	<!--多图文编辑  b-->
                <!--span5 B-->
                <div class="span5 msg-preview" style="width:380px;float:left;">
                    <div class="msg-item-wrapper">
                        <div id="appmsgItem1" class="appmsgItem msg-item">
                            <p class="msg-meta">
                                <span class="msg-date"><?php echo outTime($rs['header']['infotime'],2)?></span>
                            </p>
                            <div class="cover">
                                <?php
								  if (!$rs['header']['picurl']){
								  ?>
									<p class="default-tip" >封面图片</p>
									<?php
								  }
									?>
                                <h4 class="msg-t">
                                    <span class="i-title"><?php echo $rs['header']['title'];?></span>
                                </h4>
                                <dl class="abs tc sub-msg-opr">                 
                                    <dd class="b-dib sub-msg-opr-item">                   
                                        <a href="javascript:;" class="th opr-icon edit-icon" title="编辑">编辑</a>                 
                                    </dd>               
                                </dl>
                                <img class="i-img" style="" src="<?php echo getImgUrl($rs['header']['picurl']);?>">
                            </div>
                            <p class="msg-text"></p>
                            <input type="hidden" value="<?php echo $rs['header']['title'];?>" class="title">
                            <input type="hidden" value="<?php echo $rs['header']['picurl'];?>" class="cover">
                            <input type="hidden" value="<?php echo getImgUrl($rs['header']['picurl']);?>" class="coverurl">
                            <textarea class="content" style="display: none;"><?php echo $rs['header']['content'];?></textarea>
                            <input type="hidden" value="<?php echo $rs['header']['url'];?>" class="sourceurl">
                            <input type="hidden" class="author" value="<?php echo $rs['header']['author'];?>">
                            <input type="hidden" class="isCover" value="<?php echo $rs['header']['is_putin'];?>">
                            <input type="hidden" class="rid" value="<?php echo $rs['header']['id'];?>">
                        </div>
                        <?php
                        foreach($rs['items'] as $val){
						?>
                        <div class="rel sub-msg-item appmsgItem">              
                            <span class="thumb">   
                               <?php
								  if (!$val['picurl']){
								  ?>           
                                <span class="default-tip" style="">缩略图</span>
                                <?php
								  }
									?>         
                                <img src="<?php echo getImgUrl($val['picurl']);?>" class="i-img">       
                            </span>       
                            <h4 class="msg-t">                    
                                <span class="i-title"><?php echo $val['title'];?></span>                
                            </h4>       
                            <dl class="abs tc sub-msg-opr">         
                                <dd class="b-dib sub-msg-opr-item edit-icon"><a href="javascript:;" class="th opr-icon edit-icon" title="编辑">编辑</a></dd>         
                                <dd class="b-dib sub-msg-opr-item del-icon"><a href="javascript:;" class="th opr-icon del-icon" title="删除">删除</a></dd>       
                            </dl>    
                            <input type="hidden" class="title" value="<?php echo $val['title'];?>">
                            <input type="hidden" class="cover" value="<?php echo $val['picurl'];?>">
                            <input type="hidden" class="coverurl" value="<?php echo getImgUrl($val['picurl']);?>">
                            <textarea class="content" style="display: none;"><?php echo $val['content'];?></textarea>
                            <input type="hidden" class="sourceurl" value="<?php echo $val['url'];?>">
                            <input type="hidden" class="author" value="<?php echo $val['author'];?>">
                            <input type="hidden" class="isCover" value="<?php echo $val['is_putin'];?>">
                            <input type="hidden" class="rid" value="<?php echo $val['id'];?>">
                        </div>
        				<?php
						}
						?>
                        <div class="sub-add">            
                            <a href="javascript:;" class="block tc sub-add-btn"><span class="vm dib sub-add-icon"></span>增加一条</a>           
                        </div>
                    </div>
                </div>
                <!--span5 E-->
                
                <!--span7 B-->
                <div class="span7" style="width:540px; float:left; margin-left:20px;">
                    <div class="msg-editer-wrapper">
                        <div class="msg-editer">
                            <div class="control-group">
                                <label class="control-label">标题</label><span class="maroon">*</span><span class="help-inline">(必填,不能超过80个字)</span>
                                <div class="controls">
                                    <input type="text" value="<?php echo $rs['header']['title'];?>" id="title" class="form-control span5" style="width: 482px;" name="title">
                                </div>
                            </div>
                            <div class="control-group">
                                <label class="control-label">作者</label><span class="help-inline">（选填）</span>
                                <div class="controls">
                                    <input type="text" value="<?php echo $rs['header']['author'];?>" id="author" class="form-control span5" style="width: 482px;" name="author">
                                </div>
                            </div>
                            <div class="control-group">
                                <label class="control-label">封面</label>
                                <div class="controls">
                                    <div class="cover-area">
                                        <div class="cover-hd">
                                            <input id="file_upload"  class="btn btn-sm btn-info m-b-small" name="file_upload" type="file" />
                                            <input id="coverurl" value="<?php echo $rs['header']['picurl'];?>" name="coverurl" type="hidden" />
                                            <input id="cover_real_url" value="" name="cover_real_url" type="hidden" />
                                        </div>
                                        <p id="upload-tip" class="upload-tip">大图：360*200，小图:200*200</p>
                                        <p id="upload-progress" style="display:none; margin-left:5px; font-size:12px"></p>
                                        <div id="imgArea" class="cover-bd">
                                        	<img src="<?php echo getImgUrl($rs['header']['picurl']);?>" id="img"/>
                                        	<a href="javascript:;" class="vb cover-del" id="delImg">删除</a>
                                        	<p id="upload-size"></p>
                                        </div>
                                    </div>
                                </div>
                                <div style="padding:5px 0;">
                                    <input type="checkbox" id="isCover" name="isCover" value="1" <?php if ($rs['header']['is_putin']){echo 'checked="checked"';};?>  style="width:15px; height:15px; margin-right:10px; vertical-align:middle;"><span style="vertical-align:middle;" >封面图片显示在正文中</span>
                                </div>
                            </div>
                            <div class="control-group">
                            <label class="control-label">正文</label> <span class="maroon"></span><span class="help-inline">(不能超过20000个字)</span>     
                                <div class="controls">
                                    <script type="text/plain" id="editor"><?php echo $rs['header']['content'];?></script>
                                </div>
                            </div>
                            <a id="url-block-link" href="javascript:void(0);" class="url-link block">添加来源</a>
                            <div id="url-block" <?php if (!$rs['header']['url']){echo 'style="display:none"';};?> class="control-group">
                                <label class="control-label">来源</label> <span class="help-inline">(请输入正确的URL链接格式)</span>          
                                <div class="controls">
                                    <input type="text" id="source_url" class="form-control span5" value="<?php echo $rs['header']['url'];?>" style="width: 482px;" name="source_url">
                                </div>
                            </div>
                            <div class="control-group">
                              <label class="control-label">排序值</label>
                              <span class="help-inline">数值越大越靠前（0-999）</span>
                              <div class="controls">
                                <input type="text" id="px" class="form-control span2" style="width:80px;" name="px" value="<?php echo $rs['header']['px'];?>" />
                              </div>
                            </div>
                            <div class="control-group">
                                <div class="controls">
                                    <button id="save-btn" type="submit" class="btn btn-primary btn-large">保存</button>
                                    <button id="cancel-btn" type="button" class="btn btn-large">取消</button>
                                </div>
                            </div>
                        </div>
                        <span class="abs msg-arrow a-out" style="margin-top: 0px;"></span>
                        <span class="abs msg-arrow a-in" style="margin-top: 0px;"></span>
                    </div>
                </div>
                <!--span7 E-->
                <div class="clear"></div>
                <input name="tid" id="tid" type="hidden" value="<?php echo $rs['header']['tid'];?>">
                <input name="id" id="id" type="hidden" value="<?php echo $rs['header']['id'];?>">
                <input id="action" type="hidden" value="mul_edit" />
                <!--多图文编辑  E-->
       </div> 
      </section>
     </div> 
    </div> 
   </section> 

  </section> 
  <!--/ content --> 
<!--主体 结束-->
<script>
var UEDITOR_HOME_URL = '<?php echo LOCAL_PUBLIC_PATH;?>ueditor/';
var fixedImagePath='';
var gotoUrl='<?php echo U('news/index',array('tid'=>$rs['header']['tid']));?>';
var postUrl='<?php echo U('news/save');?>';
var postPicUrl='<?php echo U('news/postpic');?>';
var uploadUrl='<?php echo U('news/upload');?>';
</script>
<?php
include getTpl('footer', 'public');
?>